//假设你正在设计一个电路来控制手机的振铃器和振动电机。
//当手机来电时(input ring)，电路必须把震动( output motor = 1 )或响铃( output ringer = 1 )打开，
//但不能同时打开。当手机处于震动模式时( input vibrate = 1 )，则打开震动( output motor = 1 )。
//否则打开响铃。

module top_module (
    input ring,
    input vibrate_mode,
    output ringer,       // Make sound
    output motor         // Vibrate
);

    assign ringer = ring & (!vibrate_mode);
    assign motor = ring & vibrate_mode;

    // When should ringer be on? When (phone is ringing) and (phone is not in vibrate mode)
	//assign ringer = ring & ~vibrate_mode;
	
	// When should motor be on? When (phone is ringing) and (phone is in vibrate mode)
	//assign motor = ring & vibrate_mode;

endmodule
